// TOWN SCRIPT
//    Town 2: Timoria

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k;

body;

beginstate INIT_STATE;
	set_name(6,"Collatinus");
	set_char_dialogue_pic(6,1949,0);
	
	if (get_flag(6,0) != 0)
		erase_char(6);
	
	set_character_pose(6,14);
	force_instant_terrain_redraw();
	
	if (get_flag(3,0) == 0) {
		set_flag(3,0,1);
		if (get_flag(6,0) == 0)
			message_dialog("When you re-enter Umbratium, you discover broken walls shredded like so much papyrus. The gates are destroyed. The buildings are torn apart. The ground is covered with blood and green slime. But who has done this?","Collatinus lays flat on his back in the middle of the town. He breathes still, although he does not move otherwise.");
		else
			message_dialog("When you re-enter Umbratium, you discover broken walls shredded like so much papyrus. The gates are destroyed. The buildings are torn apart. The ground is covered with blood and green slime. Someone has destroyed this place.","");
		}
break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
	if ((get_crime_level() > 0) && (get_flag(250,3) == 0)) {
		set_flag(250,3,1);
		message_dialog("You feel a chill come over you. The gods have seen your crimes, and they will certainly punish you. The only questions are when and how.","");
		}
		
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"They're gone.");
break;

beginstate 10;
break;